# Hey Emacs, this is a -*- makefile -*-

TMRCNT1_DEVICES = at90can32
TMRCNT1_DEVICES += at90can64
TMRCNT1_DEVICES += at90can128
TMRCNT1_DEVICES += at90pwm3
TMRCNT1_DEVICES += at90pwm3b
TMRCNT1_DEVICES += at90pwm316
TMRCNT1_DEVICES += at90usb82
TMRCNT1_DEVICES += at90usb162
TMRCNT1_DEVICES += at90usb646
TMRCNT1_DEVICES += at90usb647
TMRCNT1_DEVICES += at90usb1286
TMRCNT1_DEVICES += at90usb1287
TMRCNT1_DEVICES += atmega8
TMRCNT1_DEVICES += atmega8u2
TMRCNT1_DEVICES += atmega16
TMRCNT1_DEVICES += atmega16a
TMRCNT1_DEVICES += atmega16m1
TMRCNT1_DEVICES += atmega16u4
TMRCNT1_DEVICES += atmega32
TMRCNT1_DEVICES += atmega32c1
TMRCNT1_DEVICES += atmega32m1
TMRCNT1_DEVICES += atmega32u2
TMRCNT1_DEVICES += atmega32u4
TMRCNT1_DEVICES += atmega32u6
TMRCNT1_DEVICES += atmega48
TMRCNT1_DEVICES += atmega48a
TMRCNT1_DEVICES += atmega48p
TMRCNT1_DEVICES += atmega64c1
TMRCNT1_DEVICES += atmega64m1
TMRCNT1_DEVICES += atmega88
TMRCNT1_DEVICES += atmega88a
TMRCNT1_DEVICES += atmega88p
TMRCNT1_DEVICES += atmega88pa
TMRCNT1_DEVICES += atmega128rfa1
TMRCNT1_DEVICES += atmega162
TMRCNT1_DEVICES += atmega164p
TMRCNT1_DEVICES += atmega164a
TMRCNT1_DEVICES += atmega165
TMRCNT1_DEVICES += atmega165p
TMRCNT1_DEVICES += atmega168
TMRCNT1_DEVICES += atmega168a
TMRCNT1_DEVICES += atmega168p
TMRCNT1_DEVICES += atmega169
TMRCNT1_DEVICES += atmega169p
TMRCNT1_DEVICES += atmega169pa
TMRCNT1_DEVICES += atmega324p
TMRCNT1_DEVICES += atmega324a
TMRCNT1_DEVICES += atmega324pa
TMRCNT1_DEVICES += atmega325
TMRCNT1_DEVICES += atmega325p
TMRCNT1_DEVICES += atmega328
TMRCNT1_DEVICES += atmega328p
TMRCNT1_DEVICES += atmega329
TMRCNT1_DEVICES += atmega329p
TMRCNT1_DEVICES += atmega329pa
TMRCNT1_DEVICES += atmega640
TMRCNT1_DEVICES += atmega644
TMRCNT1_DEVICES += atmega644a
TMRCNT1_DEVICES += atmega644p
TMRCNT1_DEVICES += atmega644pa
TMRCNT1_DEVICES += atmega645
TMRCNT1_DEVICES += atmega649
TMRCNT1_DEVICES += atmega649p
TMRCNT1_DEVICES += atmega1280
TMRCNT1_DEVICES += atmega1281
TMRCNT1_DEVICES += atmega1284p
TMRCNT1_DEVICES += atmega2560
TMRCNT1_DEVICES += atmega2561
TMRCNT1_DEVICES += atmega3250
TMRCNT1_DEVICES += atmega3250p
TMRCNT1_DEVICES += atmega3290
TMRCNT1_DEVICES += atmega3290p
TMRCNT1_DEVICES += atmega6450
TMRCNT1_DEVICES += atmega6490
TMRCNT1_DEVICES += atmega8535
TMRCNT1_DEVICES += attiny24
TMRCNT1_DEVICES += attiny24a
TMRCNT1_DEVICES += attiny44
TMRCNT1_DEVICES += attiny44a
TMRCNT1_DEVICES += attiny48
TMRCNT1_DEVICES += attiny84
TMRCNT1_DEVICES += attiny88
TMRCNT1_DEVICES += attiny2313
TMRCNT1_DEVICES += attiny2313a
TMRCNT1_DEVICES += attiny4313


#broken
#TMRCNT1_DEVICES += at90pwm1
#TMRCNT1_DEVICES += at90pwm2
#TMRCNT1_DEVICES += at90pwm2b
#TMRCNT1_DEVICES += at90pwm81
#TMRCNT1_DEVICES += at90pwm216
#TMRCNT1_DEVICES += atmega16hva2
#TMRCNT1_DEVICES += atmega16hvb
#TMRCNT1_DEVICES += atmega32hvb
#TMRCNT1_DEVICES += atmega64
#TMRCNT1_DEVICES += atmega64hve
#TMRCNT1_DEVICES += atmega103
#TMRCNT1_DEVICES += atmega128
#TMRCNT1_DEVICES += atmega161
#TMRCNT1_DEVICES += atmega163
#TMRCNT1_DEVICES += atmega169a
#TMRCNT1_DEVICES += atmega323
#TMRCNT1_DEVICES += atmega406
#TMRCNT1_DEVICES += atmega645a
#TMRCNT1_DEVICES += atmega645p
#TMRCNT1_DEVICES += atmega649a
#TMRCNT1_DEVICES += atmega6450a
#TMRCNT1_DEVICES += atmega6450p
#TMRCNT1_DEVICES += atmega6490a
#TMRCNT1_DEVICES += atmega6490p
#TMRCNT1_DEVICES += attiny11 #Not supported by C compiler
#TMRCNT1_DEVICES += attiny12 #Not supported by C compiler
#TMRCNT1_DEVICES += attiny13
#TMRCNT1_DEVICES += attiny13a
#TMRCNT1_DEVICES += attiny15 #Not supported by C compiler
#TMRCNT1_DEVICES += attiny25
#TMRCNT1_DEVICES += attiny26
#TMRCNT1_DEVICES += attiny28 #Not supported by C compiler
#TMRCNT1_DEVICES += attiny43u
#TMRCNT1_DEVICES += attiny45
#TMRCNT1_DEVICES += attiny85
#TMRCNT1_DEVICES += attiny87
#TMRCNT1_DEVICES += attiny167
#TMRCNT1_DEVICES += attiny261
#TMRCNT1_DEVICES += attiny261a
#TMRCNT1_DEVICES += attiny461
#TMRCNT1_DEVICES += attiny461a
#TMRCNT1_DEVICES += attiny861
#TMRCNT1_DEVICES += attiny861a

TMRCNT1_OBJS=$(TMRCNT1_DEVICES:%=$(OBJDIR)/%/tmrcnt1.o)

TMRCNT1_TARGETS=$(TMRCNT1_DEVICES:%=$(OUTDIR_LIB)/%/libtmrcnt1.a)

TMRCNT1_OBJDIRS=$(TMRCNT1_DEVICES:%=$(OBJDIR)/%)
TMRCNT1_OUTDIRS=$(TMRCNT1_DEVICES:%=$(OUTDIR_LIB)/%)

TMRCNT1_HEADER = $(OUTDIR_HEADER)/tmrcnt1.h

$(OBJDIR)/%/tmrcnt1.o : tmrcnt1.c tmrcnt1.h
	$(CC) -c -mmcu=$* $(ALL_CFLAGS) $< -o $@

$(OUTDIR_LIB)/%/libtmrcnt1.a: $(TMRCNT1_OBJS)
	$(AR) $@ $(OBJDIR)/$*/tmrcnt1.o

# Create object files directory
$(shell mkdir -p $(TMRCNT1_OBJDIRS))
$(shell mkdir -p $(TMRCNT1_OUTDIRS))
